#!/usr/bin/env python

#extract scores out of outdock_file

import sys, string
from openeye.oechem import *

ifs = oemolistream(sys.argv[1])

out_file = open(sys.argv[2], 'w')
mol = OEGraphMol()

counter = 1


while OEReadMolecule(ifs, mol):
	name = mol.GetTitle()
	print name
	for atom in mol.GetAtoms():
		if atom.GetPartialCharge() == -3:
			print atom.GetPartialCharge(), atom.GetName()
			c_number = str(atom.GetIdx() + 1)
			print c_number
			for nb in atom.GetAtoms():
				print nb.GetName()
				s_number = str(nb.GetIdx() + 1)
				print s_number
	out_file.write(str(counter) + '\t' + name + '\t' + c_number + '\t' + s_number + '\n')
	counter = counter + 1




  
out_file.close()
ifs.close()




